package com.neusoft.hifly.commons.exception;

/**
 * Title: 核心类库
 * <p>
 * Description: 异常编码
 * <p>
 * Copyright: 2019
 * <p>
 * Company: 东软汉枫
 *
 * @author lh_neu
 * @version 1.0.0
 */
public enum ErrorCode {
	SUCCESS(0, "成功"),

	ERROR(-1001, "失败"),

	TIMEOUT(-408, "请求超时"),

	TIMER(-200, "定时器错误");

	// 编码
	private int code;

	// 信息
	private String msg;

	ErrorCode(final int code, final String msg) {
		this.code = code;
		this.msg = msg;
	}

	@Override
	public String toString() {
		return "{\"code\":" + code + ",\"msg\":\"" + msg + "\"}";
	}

	public int getCode() {
		return code;
	}

	public void setCode(final int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(final String msg) {
		this.msg = msg;
	}
}
